
*********************************************************************************************************
**** Title: Emotions in the Aisles: Unpacking the Use of Emotive Language in the UK House of Commons
*** Author: Tevfik Murat Yildirim
** Journal: European Journal of Political Research
*********************************************************************************************************
cd "/Users/tevfikmuratyildirim/Desktop"
use "/Users/tevfikmuratyildirim/Desktop/Yildirim2024_EJPR.dta", clear


* Create the DVs: 'emotive rhetoric', 'negative' and 'non-negative'
gen emotive = 1-neutral
gen negative = anger+disgust+sadness+fear
gen non_negative = joy+surprise

*********************************************************************************************************
* Summary statistics - Appendix A
estpost tabstat emotive majority_perc opp mp_exp left_right seat_share n_words rep_gender age km electorate turnout parlPeriod electionperiod,  ///
statistics(n mean sd min max) columns(statistics)
esttab . using "myfilex.tex", cells("n mean sd min max") replace



*********************************************************************************************************
* Table 1: Correlates of Emotive Rhetoric in Legislative Debates – Multilevel Poisson Regressions with Robust Standard Errors
*********************************************************************************************************
mepoisson emotive /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
eststo reg0
estat ic

mepoisson negative /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
eststo reg1
estat ic

mepoisson non_negative /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
eststo reg2
estat ic

esttab reg0 reg1 reg2 using latextable.tex, title("reg") append starlevels(* 0.1 ** 0.05 *** 0.01)




*********************************************************************************************************
* Figure 1: Correlates of Individual Emotion Categories in Legislative Debates - The Role of Electoral Safety, Parliamentary Experience and Party Status

* AND

* Table C1 in the Appendix: Correlates of Individual Emotion Categories in Legislative Debates – Multilevel Poisson Regressions with Robust Standard Errors
*********************************************************************************************************

mepoisson anger /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
estimates store anger
eststo reg3
estat ic

mepoisson disgust /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
estimates store disgust
eststo reg4
estat ic

mepoisson fear /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share ///
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
estimates store fear
eststo reg5
estat ic

mepoisson sadness /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
estimates store sadness
eststo reg6
estat ic

mepoisson joy /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
estimates store joy
eststo reg7
estat ic

mepoisson surprise /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
estimates store surprise
eststo reg8
estat ic

esttab reg3 reg4 reg5 reg6 reg7 reg8 using separate_emotions.tex, title("reg") append starlevels(* 0.1 ** 0.05 *** 0.01)





* Turn this into a coefplot - Figure 1
coefplot anger, ci(90) aspect(1) keep(majority_perc mp_exp opp) rescale(mp_exp=100 majority_perc=100) /// 
	xline(0, lpattern(shortdash)) ///
	xscale(range(-0.8 0.8)) ///
	rename(majority_perc = "Electoral Safety" ///
	mp_exp = "Parliamentary Experience" ///
	opp = "Opposition Party" ///
	) `display' `ci' name(anger, replace)
	
coefplot disgust, ci(90) aspect(1) keep(majority_perc mp_exp opp) rescale(mp_exp=100 majority_perc=100) /// 
	xline(0, lpattern(shortdash)) ///
	xscale(range(-0.8 0.8)) ///
	rename(majority_perc = "Electoral Safety" ///
	mp_exp = "Parliamentary Experience" ///
	opp = "Opposition Party" ///
	) `display' `ci' name(disgust, replace)
	
coefplot fear, ci(90) aspect(1) keep(majority_perc mp_exp opp) rescale(mp_exp=100 majority_perc=100) /// 
	xline(0, lpattern(shortdash)) ///
	xscale(range(-0.8 0.8)) ///
	rename(majority_perc = "Electoral Safety" ///
	mp_exp = "Parliamentary Experience" ///
	opp = "Opposition Party" ///
	) `display' `ci' name(fear, replace)
	
coefplot sadness, ci(90) aspect(1) keep(majority_perc mp_exp opp) rescale(mp_exp=100 majority_perc=100) /// 
	xline(0, lpattern(shortdash)) ///
	xscale(range(-0.8 0.8)) ///
	rename(majority_perc = "Electoral Safety" ///
	mp_exp = "Parliamentary Experience" ///
	opp = "Opposition Party" ///
	) `display' `ci' name(sadness, replace)

coefplot joy, ci(90) aspect(1) keep(majority_perc mp_exp opp) rescale(mp_exp=100 majority_perc=100) /// 
	xline(0, lpattern(shortdash)) ///
	xscale(range(-0.8 0.8)) ///
	rename(majority_perc = "Electoral Safety" ///
	mp_exp = "Parliamentary Experience" ///
	opp = "Opposition Party" ///
	) `display' `ci' name(joy, replace)
	
coefplot surprise, ci(90) aspect(1) keep(majority_perc mp_exp opp) rescale(mp_exp=100 majority_perc=100) /// 
	xline(0, lpattern(shortdash)) ///
	xscale(range(-0.8 0.8)) ///
	rename(majority_perc = "Electoral Safety" ///
	mp_exp = "Parliamentary Experience" ///
	opp = "Opposition Party" ///
	) `display' `ci' name(surprise, replace)
	
graph combine anger disgust fear sadness joy surprise, cols(2) xcommon


*********************************************************************************************************
* Figure 2, Figure 3 and Figure 4
*********************************************************************************************************


***  Figure 2
mepoisson anger /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(majority_perc=(0(10)70)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(anger_safety_po, replace)

mepoisson disgust /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(majority_perc=(0(10)70)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(disgust_safety_po, replace)

mepoisson fear /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(majority_perc=(0(10)70)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(fear_safety_po, replace)

mepoisson sadness /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share ///
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(majority_perc=(0(10)70)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(sadness_safety_po, replace)

mepoisson joy /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share ///
n_words ///
rep_gender age /// 
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(majority_perc=(0(10)70)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(joy_safety_po, replace)


mepoisson surprise /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age /// experience & age & gender ...... 
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(majority_perc=(0(10)70)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(surprise_safety_po, replace)


***  Figure 3

mepoisson anger /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age /// 
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(mp_exp=(0(5)50)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(anger_exp_po, replace)

mepoisson disgust /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(mp_exp=(0(5)50)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(disgust_exp_po, replace)

mepoisson fear /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(mp_exp=(0(5)50)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(fear_exp_po, replace)

mepoisson sadness /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(mp_exp=(0(5)50)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(sadness_exp_po, replace)

mepoisson joy /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(mp_exp=(0(5)50)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(joy_exp_po, replace)


mepoisson surprise /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(mp_exp=(0(5)50)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(surprise_exp_po, replace)


***  Figure 4

mepoisson anger /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(opp=(0(1)1)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(anger_opp_po, replace)

mepoisson disgust /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(opp=(0(1)1)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(disgust_opp_po, replace)

mepoisson fear /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(opp=(0(1)1)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(fear_opp_po, replace)

mepoisson sadness /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age /// 
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(opp=(0(1)1)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(sadness_opp_po, replace)

mepoisson joy /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age ///  
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(opp=(0(1)1)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(joy_opp_po, replace)


mepoisson surprise /// DV
majority_perc /// 
mp_exp ///
opp ///
left_right seat_share /// 
n_words ///
rep_gender age /// 
km electorate turnout i.captopic i.parlPeriod electionperiod if n_sentences>1 ||actors:, vce(robust)
margins, at(opp=(0(1)1)) level(95)
marginsplot, recast(line) plot1opts(lcolor(black)) name(surprise_opp_po, replace)



